{include file="common/header.tpl"}
<body>
{* We set current tab is MANAGE *}
{assign var="manage" value="current"}
{include file="common/toptab.tpl"}

{* Check which item is currently active and set active tab to it*}
{if $smarty.get.sub1 eq "category"}
	{assign var="category" value="current"}
{elseif $smarty.get.sub1 eq "product"}
	{assign var="product" value="current"}
{elseif $smarty.get.sub1 eq "news"}
	{assign var="news" value="current"}
{else}
	{assign var="page" value="current"}
{/if}
<div id="tabs4">
	<ul>
		<li id="{$page}"><a href="?mod=manage&sub1=page"><span>{t}Page{/t}</span></a></li>
		<li id="{$category}"><a href="?mod=manage&sub1=category"><span>{t}Category{/t}</span></a></li>
        <li id="{$news}"><a href="?mod=manage&sub1=news"><span>{t}News{/t}</span></a></li>
	</ul>
</div>

{* Check which item is currently active and load correspond template*}
{if $smarty.get.sub1 eq "category"}
	<script src="includes/js/category.js" type="text/javascript"></script>
    <script src="includes/js/tiny_mce/tiny_mce.js" type="text/javascript"></script>
	<script src="includes/js/editor.js" type="text/javascript"></script>
    {if $smarty.get.act eq "newcategory"}
		{include file="manage_addcategory.tpl"}
    {elseif $smarty.get.act eq "position"}
		{include file="position.tpl"}    
    {else}
		{include file="manage_category.tpl"}
    {/if}    
{elseif $smarty.get.sub1 eq "product"}
	<script src="includes/js/tiny_mce/tiny_mce.js" type="text/javascript"></script>
	<script src="includes/js/editor.js" type="text/javascript"></script>
	<script src="includes/js/product.js" type="text/javascript"></script>
	{if $smarty.get.act eq "newproduct"}
		{include file="manage_addproduct.tpl"}
	{elseif $smarty.get.act eq "editproduct"}
		{include file="manage_editproduct.tpl"}
	{else}
		{include file="manage_product.tpl"}
	{/if}
{elseif $smarty.get.sub1 eq "news"}
	<script src="includes/js/news.js" type="text/javascript"></script>
	{if $smarty.get.act eq "addnews"}
		{include file="manage_addnews.tpl"}
	{elseif $smarty.get.act eq "editnews"}
		{include file="manage_editnews.tpl"}
	{else}
		{include file="manage_news.tpl"}
	{/if}
{elseif $smarty.get.sub1 eq "editcategory"}
	<script src="includes/js/tiny_mce/tiny_mce.js" type="text/javascript"></script>
	<script src="includes/js/editor.js" type="text/javascript"></script>
	<script src="includes/js/category.js" type="text/javascript"></script>
	{if $THECAT != null}
		{include file="manage_editcategory.tpl"}
	{else}
		{include file="manage_category.tpl"}
	{/if}
{else}
	<script src="includes/js/page.js" type="text/javascript"></script>
	{if $smarty.get.act eq "newpage"}
		{include file="manage_addpage.tpl"}
	{elseif $smarty.get.act eq "editpage"}
		{include file="manage_editpage.tpl"}		
	{else}
		{include file="manage_page.tpl"}
	{/if}
{/if}
</body>
</html>